package com.fau.om.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.json.simple.JSONAware;
import org.json.simple.JSONObject;

/**
 * @desc 媒体订单统计表实体类
 * @author kangyj
 * @datetime 2014年12月11日,下午4:17:20
 */
@Entity
@Table(name = "medical_orders_media_sta")
public class MedicalOrdersMediaSta implements Serializable, JSONAware {

	private static final long serialVersionUID = 6016419742258607766L;
	
	private String id;
	private String ordersId;			// 订单id
	private String mediaId;				// 媒体id
	private String mediaName;			// 媒体名称
	private BigDecimal commodityMoney;	// 货款金额
	private BigDecimal freight;			// 运费
	private String ridePin;				// 是否搭销单
	private Date ordersTime;			// 订单时间
	private String hospitalId;			// 医院id
	private String startTime;			// 下单开始时间
	private String endTime;				// 下单结束时间
	private Integer ordersCount;		// 订单数
	private BigDecimal tcommodityMoney;	// 货款金额
	private BigDecimal tfreight;		// 运费
	private BigDecimal totalMoney;		// 总金额
	private Integer ridePinCount;		// 搭销单数
	private BigDecimal ridePinProportion;	// 搭销比例
	
	private Date stime;
	private Date etime;
	
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "orders_id", length = 32)
	public String getOrdersId() {
		return ordersId;
	}

	public void setOrdersId(String ordersId) {
		this.ordersId = ordersId;
	}

	@Column(name = "media_id", length = 32)
	public String getMediaId() {
		return mediaId;
	}

	public void setMediaId(String mediaId) {
		this.mediaId = mediaId;
	}
	
	@Column(name = "media_name", length = 30)
	public String getMediaName() {
		return mediaName;
	}

	public void setMediaName(String mediaName) {
		this.mediaName = mediaName;
	}

	@Column(name = "commodity_money", length = 11)
	public BigDecimal getCommodityMoney() {
		return commodityMoney;
	}

	public void setCommodityMoney(BigDecimal commodityMoney) {
		this.commodityMoney = commodityMoney;
	}

	@Column(name = "freight", length = 11)
	public BigDecimal getFreight() {
		return freight;
	}

	public void setFreight(BigDecimal freight) {
		this.freight = freight;
	}

	@Column(name = "ride_pin", length = 11)
	public String getRidePin() {
		return ridePin;
	}

	public void setRidePin(String ridePin) {
		this.ridePin = ridePin;
	}

	@Column(name = "orders_time")
	public Date getOrdersTime() {
		return ordersTime;
	}

	public void setOrdersTime(Date ordersTime) {
		this.ordersTime = ordersTime;
	}

	@Column(name = "hospital_id", length = 11)
	public String getHospitalId() {
		return hospitalId;
	}

	public void setHospitalId(String hospitalId) {
		this.hospitalId = hospitalId;
	}

	@Transient
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	@Transient
	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	@Transient
	public Integer getOrdersCount() {
		return ordersCount;
	}

	public void setOrdersCount(Integer ordersCount) {
		this.ordersCount = ordersCount;
	}
	
	@Transient
	public BigDecimal getTcommodityMoney() {
		return tcommodityMoney;
	}

	public void setTcommodityMoney(BigDecimal tcommodityMoney) {
		this.tcommodityMoney = tcommodityMoney;
	}

	@Transient
	public BigDecimal getTfreight() {
		return tfreight;
	}

	public void setTfreight(BigDecimal tfreight) {
		this.tfreight = tfreight;
	}

	@Transient
	public BigDecimal getTotalMoney() {
		return totalMoney;
	}

	public void setTotalMoney(BigDecimal totalMoney) {
		this.totalMoney = totalMoney;
	}

	@Transient
	public Integer getRidePinCount() {
		return ridePinCount;
	}

	public void setRidePinCount(Integer ridePinCount) {
		this.ridePinCount = ridePinCount;
	}

	@Transient
	public BigDecimal getRidePinProportion() {
		return ridePinProportion;
	}

	public void setRidePinProportion(BigDecimal ridePinProportion) {
		this.ridePinProportion = ridePinProportion;
	}

	@Transient
	public Date getStime() {
		return stime;
	}

	public void setStime(Date stime) {
		this.stime = stime;
	}

	@Transient
	public Date getEtime() {
		return etime;
	}

	public void setEtime(Date etime) {
		this.etime = etime;
	}

	@SuppressWarnings("unchecked")
	@Override
	public String toJSONString() {
		JSONObject obj = new JSONObject();
		obj.put("ordersId", ordersId);
		obj.put("mediaName", mediaName);
		obj.put("ordersCount", ordersCount);
		obj.put("tcommodityMoney", tcommodityMoney);
		obj.put("tfreight", tfreight);
		obj.put("totalMoney", totalMoney);
		obj.put("ridePinCount", ridePinCount);
		obj.put("ridePinProportion", ridePinProportion);
		return obj.toString();
	}

}
